﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections.ObjectModel;
using RssReaderTemplate.Model;
using System.Runtime.Serialization;

namespace RssReaderTemplate.ViewModels
{
    [DataContract]
    public class CategoryViewModel : ViewModelBase
    {
        public CategoryViewModel(string name)
        {
            _name = name;
            _elements = new ObservableCollection<RssItem>();
        }

        private string _name;
        [DataMember]
        public string Name
        {
            get { return _name; }
            set 
            {
                _name = value;
                OnPropertyChanged("Name");
            }
        }

        private int _selectedItemIndex = -1;
        [IgnoreDataMember]
        public int SelectedItemIndex
        {
            get { return _selectedItemIndex; }
            set { _selectedItemIndex = value; }
        }

        private ObservableCollection<RssItem> _elements;
        [DataMember]
        public ObservableCollection<RssItem> Elements
        {
            get { return _elements; }
            set { _elements = value; }
        }


    }
}
